package com.example.base_kotlin_xml.view

import android.graphics.Color
import com.blankj.utilcode.util.LogUtils
import com.example.base_kotlin_xml.R
import com.example.base_kotlin_xml.databinding.ActivityCustomBinding
import com.example.base_model.view.BaseActivity
import com.example.base_model.view.custom.WaveSideBar
import dagger.hilt.android.AndroidEntryPoint

/**
 * @Author: jiangKunKun
 * @CreateDate: 2025/10/14
 * @Description: 自定义view
 * @SpittingGrooves:
 */
@AndroidEntryPoint
class CustomActivity : BaseActivity<ActivityCustomBinding>() {
    override fun initObservers() {
    }

    override fun initClickEvents() {
    }

    override fun initData() {
        mBinding.wsb.setTextColor(Color.BLACK)        // 设置文字颜色
        mBinding.wsb.setTextSize(20)                   // 设置文字大小(sp)
        mBinding.wsb.setPosition(WaveSideBar.TEXT_ALIGN_CENTER)  // 设置位置(左侧或右侧)
        mBinding.wsb.setTextAlign(WaveSideBar.TEXT_ALIGN_CENTER) // 设置文字对齐方式
        mBinding.wsb.setMaxOffset(100)                 // 设置最大偏移量(dp)
//        mBinding.wsb.setLazyRespond(true)
        mBinding.wsb.setIndexItems("A", "B", "C", "D", "E", "F", "G", "H", "I",
            "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", "#")

        // 设置选中监听器
        mBinding.wsb.setOnSelectIndexItemListener { text ->
            LogUtils.e("选中: $text")
        }


    }

    override fun attachLayoutRes(): Int = R.layout.activity_custom
}